package com.littlenb.mybatisjpa.persistence;


import javax.persistence.Column;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 *数据库字段注解
 * 为 javax.persistence.Column  补强功能，原先方案是直接 重写Column，感觉有点不妥
 * @author viaco  for Java Persistence 1.0
 */
@Target({METHOD, FIELD})
@Retention(RUNTIME)
public @interface  MyColumn  {


    /**
     * 是否数据库字段转化成下划线命名
     * @return
     */
    boolean camelToUnderline()  default false;

    /**
     * TODO: 没有实现具体功能
     * 是否修改大小写配置
     *   com.littlenb.mybatisjpa.support.Constant.DEFAULT_CASE_MODE =0;
     *
     *   com.littlenb.mybatisjpa.support.Constant.UPPER_CASE_MODE = 1;
     *
     *   com.littlenb.mybatisjpa.support.Constant.LOWER_CASE_MODE = 2;
     *   -1 忽略这个属性
     * @return
     */
    int caseMode()  default -1;
}
